package cn.itcast.bos.dao.base;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.test.annotation.Rollback;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.domain.base.Standard;

public interface StandardRepository extends JpaRepository<Standard, Integer>{
	
	public List<Standard> findByName(String name);
	
	@Query(value="from Standard where name=?",nativeQuery=false)
	//nativeQuery=false,表示的是查询jpql语句,true表示的是查询sql语句
	public List<Standard> queryName(String name);
	
	/*@Query
	public List<Standard> queryUsername(String name);*/
	
	//更改数据库中的数据
	@Query("update Standard set minLength=?2 where id=?1")
	@Modifying
	//@Rollback(true)
	public void updateMinLength(Integer id,Integer minLength);
	
	
}
